<%-- 
    Document   : newjsp
    Created on : Oct 28, 2009, 3:50:43 AM
    Author     : Phong
--%>

<%@page contentType="text/html" pageEncoding="UTF-8" import="java.util.*,DAOClass.InfoMember"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

 <%@include file="include/validate.jsp" %>
        <link rel="stylesheet" href="../css/style.css" />
        <link rel="stylesheet" href="../css/front.css"  />
        <link rel="stylesheet" href="../css/backend.css" />

        <title>JSP Page</title>
        <style type="text/css">
            <!--
            .userManager tr td strong {
                color: #F00;
            }
            -->
        </style>
        <script type="text/javascript" language="JavaScript">
            function block()    {
                
            }
        </script>
    </head>
    <body bgcolor="#154978">
        <jsp:include page="include/validate.jsp" flush="true"></jsp:include>
        <jsp:useBean id="mem" class="DAOClass.Members" >

        </jsp:useBean>

        <table width="1024" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" align="center">
            <!--DWLayoutTable-->
            <tr>
                <td width="1024" height="157" valign="top" background="../images/Banner.jpg">

                </td>
            </tr>
            <tr>
                <td height="463" valign="top">
                    <table width="100%" border="0" cellpadding="2" cellspacing="2">
                        <!--DWLayoutTable-->
                        <tr>
                            <td height="28" colspan="2" valign="top" background="../images/top_button.gif" align="right">
                                              <span class="titleMenu">
              <a href="../index.jsp">Home Page</a> &nbsp;&nbsp; ||&nbsp;&nbsp;
              <a href="../include/logoff.jsp">Logoff</a>
              &nbsp;&nbsp;&nbsp;
              </span>
                            </td>
                        </tr>
                        <tr>
                            <td width="150" height="537" valign="top" style="background-color:#666666">

                                <!-- MENU -->
                                <%@include file="menu.jsp" %>
                                <!--END MENU-->	</td>

                            <td width="858" align="center" valign="top" style="margin-top:30px">


                                <%
            ArrayList<InfoMember> listMember = new ArrayList<InfoMember>();
            listMember = mem.getMembers();

                                %>
                                <h2 style="margin-top:30px; color: #F00;">User Management</h2>
                                <table border="0" width="95%" align="center" class="userManager" style="border:1px solid ">
                                    <tr>
                                        <td width="23%" height="32" class="titUserManager"> UserName</td>
                                        <td width="30%" class="titUserManager"> Email</td>
                                        <td width="17%" class="titUserManager"> Sex</td>
                                        <td width="12%" class="titUserManager"> Group</td>
                                        <td width="6%" class="titUserManager"> Status</td>
                                        <td colspan="3" class="titUserManager">Action</td>
                                    </tr>
                                    <tr>
                                        <td colspan="6"></td>
                                    </tr>
                                    <%
            if (listMember.size() > 0) {
                for (int i = 0; i < listMember.size(); i++) {
                    String strNameGroup = "";
                    String strStatus = "";
                    String strSex = "";



                    String strUser = listMember.get(i).getUserName();
                    int intIDG = listMember.get(i).getGroup();
                    String strName = listMember.get(i).getFullName();
                    int intSex = listMember.get(i).getSex();
                    String strBirthDay = listMember.get(i).getBirthDay();
                    String strAdd = listMember.get(i).getAddress();
                    String strMail = listMember.get(i).getEmail();
                    int intStatus = listMember.get(i).getStatus();

                    if (intIDG == 1) {
                        strNameGroup = "Admin";
                    } else {
                        strNameGroup = "Member";
                    }
                    if (intStatus == 1) {
                        strStatus = "../images/button/system/16-em-check.png";
                    } else {
                        strStatus = "../images/button/system/16-em-cross.png";
                    }
                    if (intSex == 1) {
                        strSex = "Male";
                    } else {
                        strSex = "Female";
                    }

                                    %>
                                    <tr>

                                        <td class="titUsername">
                                            <a href onclick="javascipt:Chitiet=window.open('udetail.jsp?u=<%=strUser%>','','resizable=false,fullscreen=no,location=no,width=440,height=400, left=600')">
                                                <%=strUser%>
                                        </td>
                                        <td>
                                            <a href="mailto:<%=strMail%>">
                                                <%=strMail%>
                                            </a>
                                        </td>
                                        <td align="center">

                                            <%=strSex%>
                                        </td>
                                        <td align="center">
                                            <%=strNameGroup%>
                                        </td>
                                        <td>
                                            <img src="<%=strStatus%>" border="0">
                                        </td>
                                        <td width="3%">
                                            <a href="editMember.jsp?u=<%=strUser%>">
                                                <img src="../images/button/system/24-tool-a.png" alt="Edit Member"  border="0"/>
                                            </a>
                                        </td>
                                        <td width="4%">
                                            <a href="include/blockUser.jsp?u=<%=strUser%>&s=<%=intStatus%>">
                                                <img src="../images/button/system/24-security-key.png" alt="Status" border="0">
                                            </a>
                                        </td>
                                        <td width="5%">
                                            <a href="addMember.jsp">
                                                <img src="../images/button/system/24-member-add.png" alt="Mode" border="0">
                                            </a>
                                        </td>
                                    </tr>
                                    <%
            }
        } else {
                                    %>
                                    <tr>
                                        <td colspan="8" align="center"><strong>There are no Members in Members List</strong></td>
                                    </tr>
                                    <%            }
                                    %>

                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>

    </body>
</html>
